<template>
<view>
<view v-for="(item, idx) in volsList" :key="idx" class="vols_item flex">
    <view class="vols">
        <image :src="item.avatar?item.avatar:'/static/images/defaultorg.png'"></image>
        <view class="star_wrapper flex" v-if="item.star">
            <view v-for="(item, index) in tools.star(item.star)" :key="index" class="star">
                <image src="/static/images/icon_star.png"></image>
            </view>
        </view>
    </view>
    <view class="text flex">
        <view class="name">{{item.real_name}}</view>
        <view class="time">{{tools.formatterDate(item.create_time,'-','year','nosecond')}}</view>
    </view>
</view>
</view>
</template>

<script module="tools" lang="wxs" src="../../utils/tools.wxs"></script>

<script>
var t = require("../../utils/request.js"),
    a = function (t) {
  return t && t.__esModule ? t : {
    default: t
  };
}(require("../../utils/api.js")),
    e = require("../../utils/util.js"),
    app = getApp(),
    n = a.default.recruitSignUpList;

export default {
  data() {
    return {
      id: "",
      loginFlag: "",
      volsList: [],
      page: 1,
      noMore: !1
    };
  },

  components: {},
  props: {},
  onLoad: function (t) {
    var a = this;
    t.id ? (this.setData({
      id: t.id,
      loginFlag: app.globalData.loginFlag
    }), this.getVolsList().then(function (t) {
      t.data.errCode === e.ERR_OK && (t.data.data.length < 10 && a.setData({
        noMore: !0
      }), console.log(t.data), a.setData({
        volsList: t.data.data
      }));
    }).catch(function (t) {
      console.log(t);
    })) : uni.navigateBack();
  },
  onReady: function () {},
  onShow: function () {},
  onHide: function () {},
  onUnload: function () {},
  onPullDownRefresh: function () {
    var t = this;
    this.setData({
      page: 1,
      noMore: !1
    }), this.getVolsList().then(function (a) {
      a.data.errCode === e.ERR_OK && (a.data.data.length < 10 && t.setData({
        noMore: !0
      }), t.setData({
        volsList: a.data.data
      }), uni.stopPullDownRefresh());
    }).catch(function (t) {
      console.log(t);
    });
  },
  onReachBottom: function () {
    var t = this;

    if (!this.noMore) {
      var a = this.page;
      this.setData({
        page: ++a
      }), this.getVolsList().then(function (a) {
        a.data.errCode === e.ERR_OK && (a.data.data.length < 10 && t.setData({
          noMore: !0
        }), t.setData({
          volsList: t.volsList.concat(a.data.data)
        }));
      }).catch(function (t) {
        console.log(t);
      });
    }
  },
  onShareAppMessage: function () {
    return {
      title: "让公益更生活 让生活更公益",
      path: "/pages/index/index",
      imageUrl: "/static/images/zyh_logo.jpg"
    };
  },
  methods: {
    getVolsList: function () {
      var a = {
        data: {
          api: n,
          id: this.id,
          page: this.page,
          rows: 10
        }
      };
      return (0, t.request)(a, "common", !0);
    }
  }
};
</script>
<style>
.vols_item {
    justify-content: flex-start;
    width: 100%;
    height: 180rpx;
    padding-left: 30rpx;
}

.vols_item .vols {
    position: relative;
    width: 90rpx;
    height: 90rpx;
    margin-right: 30rpx;
}

.vols image {
    width: 90rpx;
    height: 90rpx;
    border: 1rpx solid #e1e2e3;
    border-radius: 50%;
}

.vols_item .star_wrapper {
    position: absolute;
    left: 0;
    bottom: 0;
    z-index: 9;
    width: 100%;
    height: 24rpx;
    background: #fff;
    border-radius: 12rpx;
    border: 1rpx solid #e1e2e3;
}

.star_wrapper .star {
    flex: 0 0 12rpx;
    width: 12rpx;
    height: 12rpx;
    margin-right: 4rpx;
    font-size: 0;
}

.star_wrapper .star:last-child {
    margin-right: 0;
}

.star_wrapper .star image {
    display: block;
    width: 12rpx;
    height: 12rpx;
    border: none;
}

.vols_item .text {
    flex: auto;
    justify-content: space-between;
    height: 180rpx;
    padding-right: 45rpx;
    line-height: 180rpx;
    font-size: 30rpx;
    border-bottom: 1rpx solid #e1e2e3;
}
</style>